<template>
  <div class="liveClass">
  	<ul>
  		<li v-for="(val,index) in list" :key='index' @click='selectCourse' :class="{'active':index==1}">
  			<a>
  				<p>
             <img src="../../image/icon_video_quantity_normal.png" width="16" height="16" alt="">
          </p>
          <div>
            <h3>
              第{{index+1}}节：预防蛀牙的防蛀牙的防蛀牙的防蛀牙的有效措施？
              <i v-show="index==1">直播中</i>
            </h3>
            <p>
              <b>2017-9-8</b>
              <time>10:30已结束</time>
             </p>
          </div>
  			</a>
  		</li>
  	</ul>
    <a class="buyBtn" @click="buyCourse" v-show='!isbuy'>购买课程</a>
    <div class="join" v-show='isbuy'>
      <router-link to='/liveInteractive' class="">进入教室</router-link>
    </div>

  </div>
</template>
<script type="text/javascript">
    export default {
        data() {
        return {
            list: [1,2,3,4],
            isShowMc2: false,
            isbuy: false,
        }
        },
        methods: {
        selectCourse() {
            if(this.buy) {

            }else {
                this.$utils._toast('您还未购买此课程!');
            }
        },
        buyCourse() {
            this.isShowMc2 = true;
            this.isbuy = true;
            this.$emit('showMc2',this.isShowMc2);
        }
        },
        created() {

        }
    }
</script>